/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Infra;
import javax.servlet.RequestDispatcher;
import javax.servlet.RequestDispatcher;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 *
 * @author jack
 */
public  class MVC {
    public static RequestDispatcher View(String url,HttpServletRequest request, HttpServletResponse response,Object model) throws ServletException{
        RequestDispatcher rd = request.getRequestDispatcher("View/login.jsp");
        try {
            request.getSession().setAttribute("Model", model);
            rd.include(request, response);
            
        } catch (IOException ex) {
            Logger.getLogger(MVC.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rd;
    }
}
